# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=plasma-framework5
pkgver=5.113.0
pkgrel=0
pkgdesc="Plasma library and runtime components based upon KF5 and Qt5"
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later AND GPL-2.0-or-later"
depends_dev="
	kactivities5-dev
	karchive5-dev
	kconfig5-dev
	kconfigwidgets5-dev
	kcoreaddons5-dev
	kdbusaddons5-dev
	kdeclarative5-dev
	kglobalaccel5-dev
	kguiaddons5-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	kirigami2-dev
	knotifications5-dev
	kpackage5-dev
	kservice5-dev
	kwayland5-dev
	kwindowsystem5-dev
	kxmlgui5-dev
	mesa-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtquickcontrols2-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	kdoctools5-dev
	qt5-qttools-dev
	samurai
	"
checkdepends="
	hicolor-icon-theme
	xvfb-run
	"
_repo_url="https://invent.kde.org/plasma/plasma-framework.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/plasma-framework-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
options="!check" # 8 out of 13 tests fail
builddir="$srcdir/plasma-framework-$pkgver"

replaces="plasma-framework<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
46a9a249600b53b8f871fb9703584aba5a62bdf93bb826e6171ab8619d2199dbe98831a10e93f47239559fbd499644c2c4b3e3b7155829b0a3aece5ecaa08cab  plasma-framework-5.113.0.tar.xz
"
